package com.itheima.health.dao;

import com.itheima.health.dto.SmsLoginParam;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface PhoneLoginDao {
    /**
     * 获取验证码
     * @param telephone
     * @param code
     */
    @Insert("insert into t_phonelogin (phone, validateCode) VALUES (#{telephone},#{code})")
    void createPhoneUser(String telephone, String code);

    /**
     * 验证码登录
     * @param telephone
     */
    @Select("select * from t_phonelogin where phone = #{telephone}")
    SmsLoginParam findByTelephone(String telephone);
}
